﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace crm_library.Controls.CompoundControls
{
	public abstract class BaseCompoundControl : UserControl
	{
		public abstract string Value { get; set; }

		public abstract override string ID { get; set; }
		public abstract override ClientIDMode ClientIDMode { get; set; }

		private Label _lbl;
		protected Label Lbl
		{
			get
			{
				if (_lbl == null)
				{
					_lbl = new Label
								{
									ID = ID + "_label",
									ClientIDMode = ClientIDMode
								};
				}
				return _lbl;
			}
		}
		public string LabelText
		{
			get { return Lbl.Text; }
			set { Lbl.Text = value; }
		}

		protected abstract override void CreateChildControls();
	}
}
